0001
0009 import Foundation
0010
0011 extension BigUInt: Hashable {
0012
0014 public var hashValue| BigInt.swift:178 | let v = abs.hashValue |
: Int {
0016 var hash: UInt64 = UInt64(count).byteSwapped
0017 for i in 0..<count {
0018 let shift: UInt64 = ((UInt64(i) << 5) - UInt64(i)) & 63
0019 let rotated = (hash >> shift) | ((hash & ((1 << shift) - 1)) << shift)
0020 hash = rotated ^ UInt64(UInt(truncatingBitPattern: Int64(self[i].hashValue &+ i)))
0021 }
0022
0023 return Int(truncatingBitPattern: hash)
0024 }
0025 }
0026